package server

import (
	"src/gcommon"
	"src/zeus/iserver"
	"src/zeus/logger"
	"src/zeus/msgdef"
	"src/zeus/threads"
	"time"
)

func (s *Server) GetNowTime() time.Time {
	return time.Now()
}

func (s *Server) GetSrvType() iserver.ServerType2 {
	return gcommon.ServerTypeLogin
}

func (s *Server) GetSrvID() uint64 {
	return s.SrvID
}

func (s *Server) GetSrvAddr() string {
	return s.addr + ":" + s.port
}

func (s *Server) FetchTempID() uint64 {
	return s.Gener.GenerateID()
}

func (s *Server) GenerateID() uint64 {
	return s.Gener.GenerateID()
}

func (s *Server) GetBaseSrvID() uint64 {
	return s.Gener.GetBaseSrvID()
}

func (_ *iserverNotImpl) GetGroupId() uint32 {
	return 0
}

func (_ *iserverNotImpl) IsSrvValid() bool {
	return false
}

type iserverNotImpl struct {
	*Server
}

// ///////////////////////// not impl, don't call ///////////////////////////

func (_ *iserverNotImpl) PostMsgToSrv(srvID uint64, msg msgdef.IMsg) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) PostClient(eid uint64, srvID uint64, msg msgdef.IMsg) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) PostClientByPID(pid uint64, msg msgdef.IMsg) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) PostMsgToSpace(srvID uint64, spaceID uint64, msg msgdef.IMsg) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) PostMsgToSrvByType(srvType iserver.ServerType2, group string, msg msgdef.IMsg) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) IsSessExist(srvID uint64) bool {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetCurSrvInfo() *iserver.ServerInfo {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetSrvIDBySrvType(srvType iserver.ServerType2) (uint64, error) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) PostMsgTolocalSrvByType(srvType iserver.ServerType2, msg msgdef.IMsg) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) IsCanConnectBySrvType(group uint32, srvType iserver.ServerType2) (ok bool) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) RangeSess(f func(sess iserver.ISess) bool) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) WatchServer() {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) OnceTimer(delayTime time.Duration, callback func(...interface{}), params ...interface{}) uint64 {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) LoopTimer(intervalTime time.Duration, callback func(...interface{}), params ...interface{}) uint64 {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) LoopTimerByCount(intervalTime time.Duration, loopCount int, callback func(...interface{}), params ...interface{}) uint64 {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) LoopDelayTimer(delayTime time.Duration, intervalTime time.Duration, callback func(...interface{}), params ...interface{}) uint64 {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) LoopDelayTimerByCount(delayTime time.Duration, intervalTime time.Duration, loopCount int, callback func(...interface{}), params ...interface{}) uint64 {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) DeleteTimerTask(timerTaskID uint64) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) DeleteAllTimerTask() {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetTickTime() time.Time {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) CreateEntityAll(entityType string, dbid uint64, initParam interface{}, syncInit bool) (iserver.IEntity, error) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) DestroyEntityAll(entityID uint64) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) CreateEntity(entityType string, entityID uint64, dbid uint64, spaceID uint64, initParam interface{}, syncInit bool, fly bool) (iserver.IEntity, error) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) DestroyEntity(entityID uint64) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) DestroyEntityByDBID(entityType string, dbID uint64) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetEntity(entityID uint64) iserver.IEntity {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetEntityByDBID(entityType string, dbid uint64) iserver.IEntity {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) TravsalEntity(entityType string, f func(iserver.IEntity)) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) TravsalEntityByGroup(entityGroup string, f func(iserver.IEntity)) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) EntityCount() int32 {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) MigrateEntity(entityID uint64, tarType uint8, tarSrvID uint64, tarSpaceID uint64) (bool, error) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) AddNeedRegType(srvType uint8) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetTypeIsInRegMap(srvType uint8) bool {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) CreateEntityByServerType(srvType uint8, e iserver.IEntity) (result bool, err error) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) RegEntityGroup(group string, e iserver.IEntity) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) UnRegEntityGroup(group string, e iserver.IEntity) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetMsgHandler() iserver.IMsgHandler {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) CallDelay(f func()) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) CallDelayWait(cb func()) error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) SetDelayCallHandle(handle iserver.IDelayCallHandle) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetDelayCallHandle() iserver.IDelayCallHandle {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) ClearAllData() {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetThreadGo() *threads.ThreadGo {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) RegProtoType(name string, protoType iserver.IEntity) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) NewEntityByProtoType(entityType string) interface{} {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetFrameDeltaTime() time.Duration {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetStartupTime() time.Time {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) Init() error {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) Close() {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetLoad() int {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) HandlerSrvInvalid(entityID uint64) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) RegEntitiesMsgProc(proc interface{}) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetGSVT() string {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) SetGSVT(s2 string) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) RegRelease(r iserver.IReleaseAble) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) TryConnectToSrv(info *iserver.ServerInfo) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) ServerSessClosed(param ...interface{}) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) ServerSessConnect(srvID uint64, srvType uint8) {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetRecover() bool {
	logger.Error("not implement, don't call me")
	panic("not impl")
}

func (_ *iserverNotImpl) GetSaveType() uint8 {
	logger.Error("not implement, don't call me")
	panic("not impl")
}
